import { IsNotEmpty, Length } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class UserDto {
  @ApiProperty({
    description: '用户名称4到16位字符',
  })
  @Length(4, 16, {
    message: '用户名长度为4到16位字符',
  })
  username: string;

  @ApiProperty({
    description: '用户密码',
  })
  @IsNotEmpty({ message: '密码不能为空' })
  password: string;

  @ApiProperty({
    description: '来源',
  })
  city: string;
}
